"UIPATH"="Appearance\Files&Folders\Files Open Warning"
"NAME"="Add File Open Warning"
"VERSION"="1.52"
"LANGUAGE"="VBScript"
"OSVERSION"="0001011"
"TEXT 1"="Add new file to the File Open Warning list"
"DESCRIPTION 1"="This plug-in allows you to add a new file type that currently does not have an open warning. After adding it, you can change the Open Warning with the "Edit File Open Warnings" plug-in."
"DESCRIPTION 2"="Please note that this will ONLY work for file types not associated with an application, for example TXT files will NOT work since they are associated with Notepad by default."
"AUTHOR"="Xteq Systems"
"CONTACTURL"="http://www.xteq.com"
"COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
sText_UnknownFile="You have set a command for unknown files. This means, there is a command in your registry that allows you to open any file even if the file type is unknown. Having this function activated, prevents the file warnings from appearing. Please deactivate the Unknown File command using the plugin and return to this plugin."
sP="HKLM\Software\Classes\"
Sub Plugin_Initialize
'check for unknown command!
sUNK_Check=RegReadValue(sP_UnknownFile)
if len(sUNK_Check)>0 then
Call MsgWarning(sText_UnknownFile)
Call Disable
end if
End Sub
Sub Plugin_Apply(ElementIndex,ElementSubIndex)
if ElementIndex=1 then
s=InputWindow("Please enter the extension of the file type, without the beginning dot, e.g. PIP instead of .PIP","PIP",1)
if IsEmpty(s)=false then
'first try to get the normal path
sPath=sP & "." & s
'check if the @ value is empty or not
sVal=RegReadValue(sPath & "\@")
if len(sVal)>0 then
'we have a value name that means, we need to dive further into the registry
sPath=sP & sVal
end if
'now check if there is a shell or shell ex folder
if RegPathExists(sPath & "\shell")=false and RegPathExists(sPath & "\shellex")=false then
if RegValueExists(sPath & "\NoOpen") then
Call MsgError("Sorry, this file type has already an open warning")
else
Call RegWriteValue(sPath & "\NoOpen","",1)
end if
else
Call MsgError("Sorry, this file is associated with an application")